package com.daka.service.impl;

import com.daka.dao.AreaCityMapper;
import com.daka.dao.AreaDistrictMapper;
import com.daka.dao.AreaProvinceMapper;
import com.daka.entity.AreaCity;
import com.daka.entity.AreaDistrict;
import com.daka.entity.AreaProvince;
import com.daka.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yangx
 * Date: 2016/8/5 0005
 * Time: 14:43
 */
@Service("areaService")
@Transactional
public class AreaServiceImpl implements AreaService {

    @Autowired
    private AreaProvinceMapper areaProvinceMapper;
    @Autowired
    private AreaCityMapper areaCityMapper;
    @Autowired
    private AreaDistrictMapper areaDistrictMapper;

    public List<AreaProvince> queryProvince(){
        return areaProvinceMapper.select();
    }

    public List<AreaCity> queryCity(String id){
        return areaCityMapper.selectByFather(id);
    }
//
    public List<AreaDistrict> queryDistrict(String id){
        return areaDistrictMapper.selectByFather(id);
    }
}
